<template>
	<view class="container">
		<view class="rightcontent" style="margin-top: 5vh;">
			<view class="" @click="fhsyy">
				<img :src="fhicon" alt="" style="width: 28px;height: 28px;margin-bottom: 1vh;"/>
			</view>
			<view class="" v-for="(item,index) in list" :key="index" >
				<view class="listnr">
					<text class="textlist" @click="textclick(item.id)">{{item.informationTitle}}</text>
					<text style="12%">{{item.createTime}}</text>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {
	
		getKnowledge
	} from '../../../api/index/index'
	export default {
		data() {
			return {
				fhicon:this.$baseURL+"/profile/upload/2025/06/07/fanhui_20250607171430A035.png",
			list:[]
			}
		},
		mounted(){
			getKnowledge().then((res) => {
				if (res.code == 200) {
					console.log(res)
					for(let i=0;i<res.total;i++){
						if(res.rows[i].informationType==uni.getStorageSync('informationType')){
							this.list.push(res.rows[i])
						}
					}
					
				}})
		},
		methods: {
			textclick(num){
				uni.navigateTo({
					url: "../index/text/text?id=" + num
				});
			},
			fhsyy(){
				console.log("返回事件")
				this.$emit('changePageKnowledgeModel', 'fistpage');
			},
			// 五险一金 界面
			wuXian() {
				uni.navigateTo({
					url:'/pages/knowledgeModel/content/content1'
				});
			},
			heTong() {
				uni.navigateTo({
					url:'/pages/knowledgeModel/content/content2'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.rightcontent{
		width: 89vw;
		height: 96vh;
		margin-left: 1vw;
		margin-right: 2vw;
	}
	.textlist{
		width: 76%;
		 white-space: nowrap;      /* 禁止换行 */
		  overflow: hidden;        /* 隐藏超出内容 */
		  text-overflow: ellipsis; /* 显示省略号 */
		  max-width: 76%;       /* 最大宽度（可选） */
		  display: inline-block;  /* 针对行内元素需要 */
		  padding-right: 8%;
	}
.listnr{
	width: 88%;
	height: 5vh;
	padding-top: 1vh;
	padding-left: 3%;
	// background-color: #5dabff;
	margin-top: 1vh;
	margin-bottom: 1vh;
	margin-left: 4%;
	margin-right: 4%;
	 border-bottom: 1rpx solid #000;
	 display: flex;
}

</style>